//
//  MineSettingYJFKViewController.m
//  shopping
//
//  Created by 马田成 on 2017/8/31.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "MineSettingYJFKViewController.h"

@interface MineSettingYJFKViewController ()
@property (weak, nonatomic) IBOutlet UITextField *phioneTF;
@property (weak, nonatomic) IBOutlet UITextView *commentTextView;
@property (nonatomic, strong) UILabel *placeHolderLabel;
@end

@implementation MineSettingYJFKViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setTitle:@"意见与反馈"];
    
    self.placeHolderLabel = [[UILabel alloc] init];
    
    self.placeHolderLabel.numberOfLines = 0;
    self.placeHolderLabel.font = [UIFont systemFontOfSize:14];
    self.placeHolderLabel.text = @"亲，我们非常重视您给我们提出的宝贵意见，帮助我们不断完善产品，谢谢！";
    self.placeHolderLabel.textColor = getColor(@"b6b6b6");
    [self.placeHolderLabel sizeToFit];
    [self.commentTextView addSubview:self.placeHolderLabel];
    
    
    [self.commentTextView setValue:self.placeHolderLabel forKey:@"_placeholderLabel"];
    // Do any additional setup after loading the view from its nib.
}
- (IBAction)tiJIaoClick:(UIButton *)sender {
    
    NSMutableDictionary *productParams=[[NSMutableDictionary alloc]init];
    NSString *token = [PublicFunction getConfigWithKey:@"token"];
    //NSString *token = @"31921bdfb836a4814a272e96004aaa25656";
    
    [productParams setValue:token forKey:@"token"];
    [productParams setValue:self.phioneTF.text forKey:@"tel"];
    [productParams setValue:self.commentTextView.text forKey:@"text"];
    [[MNetworkHandler sharedInstance]conURL:adminFeedbackAdd networkType:NetWorkPOST params:productParams delegate:nil showHUD:NO successBlock:^(id returnData) {
        
        
        if ([[returnData objectForKey:@"code"]intValue]==1) {
            
            [PublicFunction showAlert:nil message:[returnData objectForKey:@"msg"] duration:5.0f];
            [self.navigationController popViewControllerAnimated:YES];
            
            
        }
        
        else {
            
            [PublicFunction showAlert:nil message:[returnData objectForKey:@"msg"] duration:5.0f];
            
        }
        
    } failureBlock:^(NSError *error) {
        
        NSLog(@"%@",error);
        
//        [PublicFunction showAlert:nil message:@"没有连接网络" duration:10.0f];
        
    }];

    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
